package com.ruoyi.project.statistics.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.statistics.service.CardProblemService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * 异常卡
 *
 * @author jia
 * @create 2020-10-31 15:58
 */
@Controller
@RequestMapping("/card_problem")
public class CardProblemController extends BaseController {

    private String prefix = "statistics";

    @Autowired
    CardProblemService cardProblemService;

    @RequiresPermissions("statistics:card_problem:view")
    @GetMapping()
    public String cardlist() {
        return prefix + "/search_problem_list";
    }

    @RequiresPermissions("statistics:card_problem:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(Map<String, String> map) {
        startPage();
        return getDataTable(cardProblemService.selectCardProblem(map));
    }

}
